<template>
    <div class="Work_dynamics">
        <ul>
            <li v-for="Work_dynamic in work_dynamics" :key="Work_dynamic">
                <span>{{ Work_dynamic.time }}</span>
                <p :class="Work_dynamic.state == 0 ? 'Success':'Reject'">{{ Work_dynamic.behavior }}</p>
            </li>
        </ul>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                work_dynamics:[]
            }
        },
        mounted(){
            this.getData()
        },
        methods: {
            getData(){
                this.$axios.get('http://sdkaohe.cn/api/report/data/workDynamics')
                .then(response=>{
                    this.work_dynamics = response.data.data
                })
                .catch(error=>{
                    console.log(error);
                    alert('网络错误，不能访问');
                })
            }
        }
    }
</script>

<style scoped>
    .Work_dynamics{
        position:absolute;
        top:175px;
        left:1640px;
        width:240px;
        height:340px;
        text-align: left;
        color:#fff;
    }
    .Work_dynamics ul{
        list-style: none;
    }
    .Work_dynamics ul li{
        border-bottom: 1px dashed #fff;
        padding: 15px 0;
    }
    .Success{
        color: #3ff402;
    }
    .Reject{
        color: #ff3000;
    }
</style>